﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LinkCard.Dao;

namespace LinkCard.CustomerView
{
    public partial class ProductList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
                return;

            var keyword = Page.RouteData.Values["keyword"];
            int pagesize = 10;
            if (keyword != null)
            {
                ltkeyword.Text = keyword.ToString();
                int curpage = 0;

                if (Request.QueryString["page"] != null)
                {
                    curpage = Convert.ToInt32(Request.QueryString["page"]);
                }
                else
                {
                    curpage = 1;
                }
                var s = new DealDao().GetDealByTag(keyword.ToString(),curpage,pagesize);
                rpcatproduct.DataSource = s;
                rpcatproduct.DataBind();
            }
            Page.Title = "Quyền lợi khách hàng - LinkCard";
        }
    }
}